package com.sunshine.lnuplus.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter
import com.sunshine.lnuplus.callback.CloseLessonDetailDialogCallBack
import com.sunshine.lnuplus.callback.EditLessonCallBack
import com.sunshine.lnuplus.model.LessonBean
import com.sunshine.lnuplus.view.LessonDetailFragment

class LessonDetailAdapter(
    fm: FragmentManager,
    private val lessonList: List<LessonBean>,
    private val callBack: CloseLessonDetailDialogCallBack,
    private val callBack1: EditLessonCallBack
) : FragmentStatePagerAdapter(fm) {

    override fun getItem(position: Int): Fragment {
        return LessonDetailFragment.newInstance(lessonList[position], callBack, callBack1)
    }

    override fun getCount(): Int {
        return lessonList.size
    }
}